package com.samuel.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author kaiji
 * @since 2021-04-06 09:45:33
 */
@RestController
@RequestMapping("order/api")
public class ConsulOrderController {

    private static final String URL = "http://cloud-payment-service/api/index";

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("index")
    public String index() {
        return restTemplate.getForObject(URL, String.class);
    }

}
